home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / boost4.zip / MANUAL2.400 < prev    next >
Text File  |  1988-03-28  |  40KB  |  902 lines

  1.                          BOOSTERS 4.0
  2.               Tools for Turbo Pascal Programmers
  3.  
  4.                           Users Guide
  5.                             Part II
  6.  
  7.           Copyright (C) 1988 George F. Smith & Company
  8.                       All Rights Reserved
  9.  
  10. The Boosters library of routines and its documentation are 
  11. protected by the Copyright Laws of the United States.  They 
  12. may not be resold, distributed, or copied without permission 
  13. in writing from George F. Smith and Company.  The only 
  14. exception is the right of the purchaser of Boosters to make an 
  15. archival copy of the distribution diskettes as a means of 
  16. securing his or her investment.
  17.  
  18. For information about Boosters, please contact:
  19.  
  20.                    George F. Smith & Company
  21.                       609 Candlewick Lane
  22.                        Lilburn, GA 30247
  23.                         (404) 923-6879
  24.  
  25. -----------------------------------------------------------
  26. MblkHeap Procedure
  27. -----------------------------------------------------------
  28. Purpose         Moves a block on a page of heap.
  29. Declaration     MblkHeap ( Hpage : HeapBuf;
  30.                            x1,y1,x2,y2,x3,y3 : Integer );
  31. Remarks         MblkHeap moves the block defined by (x1,y1)
  32.                 and (x2,y2) on Hpage to the location beginning
  33.                 at (x3,y3).  The original block is filled with
  34.                 blanks and an attribute of 0Eh (intense 
  35.                 yellow on black).
  36. See also        CblkHeap
  37. Example         Emulate page scrolling by moving text up one
  38.                 line on Page[1] of the heap.
  39.                    MblkHeap ( Page[1],1,2,80,25,1,1 );
  40.  
  41. -----------------------------------------------------------
  42. MoveBg Procedure
  43. -----------------------------------------------------------
  44. Purpose         Nondestructively moves a block on the screen.
  45. Declaration     MoveBg ( Hpage : HeapBuf;
  46.                          x1,y1,x2,y2,x3,y3 : Integer );
  47. Remarks         When used in a loop, this routine gives the
  48.                 impression of a box moving over a background
  49.                 without disturbing the screen.  The screen
  50.                 (without the box) should be saved on Hpage.
  51.                 The box should then be created on the screen.
  52.                 MoveBg will: 
  53.                      - copy the box defined by (x1,y1)
  54.                        and (x2,y2) to the stack
  55.                      - refresh the screen from Hpage
  56.                      - copy the box from the stack to the
  57.                        screen beginning at (x3,y3)
  58. Example         Move a box over the screen without erasing
  59.                 anything.
  60.                    {---  Load or build a screen first  ---}
  61.                            .
  62.                            .
  63.                            .
  64.                    {---  Save it to the heap  ---}
  65.                    SaveScreen ( Page[1] );
  66.  
  67.                    {---  Create a box (or menu) or some kind  ---}
  68.                    Box ( 20,8,40,17,1,14 );
  69.  
  70.                    {---  Using animation, move the box  ---}
  71.                    for i := 0 to 15 do begin
  72.                       MoveBg ( Page[1], 20+1*2,  8,
  73.                                         40+i*2, 17,
  74.                                         22+i*2,  8 );
  75.                       delay(4);
  76.                    end;
  77.  
  78. -----------------------------------------------------------
  79. MoveBlk Procedure
  80. -----------------------------------------------------------
  81. Purpose         Moves a block on the screen.
  82. Declaration     MoveBlk ( x1,y1,x2,y2,x3,y3 : Integer );
  83. Remarks         Saves the block defined by (x1,y1),(x2,y2)
  84.                 to the stack, fills the original block
  85.                 location on the screen with blanks and
  86.                 attribute 0Eh, then copies the block from
  87.                 the stack to (x3,y3).
  88. See also        MoveBlkr, CopyBlk
  89. Example         Swap two paragraphs of text on the screen.
  90.                    Assume paragraphs defined at
  91.                    (1,5),(72,10) and (1,12),(72,17).
  92.  
  93.                    {---  Page[1] is a scratch area  ---}
  94.                    {---  Save the top pp to the heap  ---}
  95.                    Scr2Heap ( Page[1],1,5,72,10,1,1);
  96.  
  97.                    {---  Replace the top pp with the 
  98.                          one beneath it  ---}
  99.                    MoveBlk (1,12,72,17,1,5);
  100.  
  101.                    {---  Complete the swap  ---}
  102.                    Heap2Scr ( Page[1],1,1,72,6,1,12 );
  103.  
  104.                    will perform the swap.
  105.  
  106. -----------------------------------------------------------
  107. MoveBlkr Procedure
  108. -----------------------------------------------------------
  109. Purpose         Moves a block on the screen.
  110. Declaration     MoveBlkr ( x1,y1,x2,y2,x3,y3 : Integer;
  111.                            Att : Byte );
  112. Remarks         Saves the block defined by (x1,y1),(x2,y2)
  113.                 to the stack, fills the original block
  114.                 location on the screen with blanks and
  115.                 attribute Att, then copies the block from
  116.                 the stack to (x3,y3).
  117. See also        MoveBlk, CopyBlk
  118. Example         See example for MoveBlk.
  119.  
  120. -----------------------------------------------------------
  121. NsOrbit Procedure
  122. -----------------------------------------------------------
  123. Purpose         Orbit a box for a specified time.
  124. Declaration     NsOrbit ( x1,y1,x2,y2 : Integer; 
  125.                           Style, Att  : Byte; 
  126.                           NumberOfSeconds : Integer );
  127. Remarks         Draws a box on the screen, gradually erases
  128.                 all but two opposing sections of the box,
  129.                 then orbits the box with those sections for
  130.                 NumberOfSeconds or until a key is pressed.
  131.  
  132.                 The original box is redrawn when the orbiting
  133.                 is finished.
  134.  
  135.                 The box dimensions are given by (x1,y1),
  136.                 (x2,y2).  Style selects the choice of sides
  137.                 (see Box Procedure), and Att specifies the
  138.                 video attribute for the sides.
  139. Example         Draw a box and orbit it for 1 second.
  140.                    NsOrbit (25,5,55,12,1,14,1);
  141.  
  142. -----------------------------------------------------------
  143. OverStr Function
  144. -----------------------------------------------------------
  145. Purpose         Overlays one string on another.
  146. Declaration     OverStr ( New, Target : String; 
  147.                           N, Len : Integer;
  148.                           Pad : Char ) : String;
  149. Result Type     String
  150. Remarks         Returns a string with New overlayed on 
  151.                 Target, beginning at position N of Target,
  152.                 for length Len.  If N > length(Target), or
  153.                 if Len > length(New), the result is padded
  154.                 accordingly with Pad.
  155. Example         Overlay some strings onto another string.
  156.                    Target := 'ABCD';
  157.                    New := '123';
  158.                    S := OverStr(New,Target,2,2,' ');
  159.                    {--- assigns 'A12D' to S ---}
  160.  
  161.                    S := OverStr(New,Target,6,6,'_');
  162.                    {--- assigns 'ABCD_123___' to S ---}
  163.  
  164. -----------------------------------------------------------
  165. PchaHeap Procedure
  166. -----------------------------------------------------------
  167. Purpose         Writes an attribute/character to the heap.
  168. Declaration     PchaHeap ( Hpage : HeapBuf; AttCh, X, Y :
  169.                            Integer );
  170. Remarks         Writes AttCh at (x,y) on Hpage of the
  171.                 heap.  AttCh is assumed to be an 
  172.                 attribute/character combination for video
  173.                 memory operations.
  174. See also        GchaHeap
  175. Example         Copy the attribute/character at (80,35)
  176.                 of Page 1 to the home position of Page 2.
  177.  
  178.                    PchaHeap ( Page[2], 
  179.                               GchaHeap(Page[1],80,25),
  180.                               1,1);
  181.  
  182. -----------------------------------------------------------
  183. Pdq Procedure
  184. -----------------------------------------------------------
  185. Purpose         Writes a string to video memory without
  186.                 altering the cursor position.
  187. Declaration     Pdq (NSEW : Char; S : String; X,Y : Integer;
  188.                      Att : Byte );
  189. Remarks         Copies S to video memory at (X,Y), with 
  190.                 attribute Att.  NSEW determines output 
  191.                 direction:
  192.                       'N' or 'n' - North (Bottom to Top)
  193.                       'S' or 's' - South (Top to Bottom)
  194.                       'E' or 'e' - East (Left to Right)
  195.                       'W' or 'w' - West (Right to Left)
  196. See also        PutStr
  197. Example         Write '1 2 3' top-to-bottom, in a single 
  198.                 column.
  199.                    Pdq ('s','1 2 3',10,5,14 );
  200.                    {--- Will display:
  201.                         1
  202.  
  203.                         2
  204.  
  205.                         3
  206.                         in column 10, row 5 ---}
  207.  
  208.  
  209. -----------------------------------------------------------
  210. PosR Function
  211. -----------------------------------------------------------
  212. Purpose         Searches a string in a forward direction.
  213. Declaration     PosR ( Needle, HayStack : String;
  214.                        Start : Integer ) : Integer;
  215. Result Type     Integer
  216. Remarks         Searches HayStack for Needle beginning
  217.                 from Start.  Returns the starting position
  218.                 of Needle, or returns zero if Needle is not
  219.                 found.
  220. See also        LastPos, Pos (Turbo Pascal)
  221. Example         Find all the 'i's in Mississippi.
  222.  
  223.                    Start := 1;
  224.                    Needle := 'i';
  225.                    HayStack := 'Mississippi';
  226.                    WriteLn('i''s are found at:');
  227.                    repeat
  228.                       WhereI := PosR(Needle,HayStack,Start);
  229.                       WriteLn(WhereI);
  230.                       Start := WhereI + Length(Needle);
  231.                    until WhereI = 0;
  232.  
  233. -----------------------------------------------------------
  234. PutHeap Procedure
  235. -----------------------------------------------------------
  236. Purpose         Writes a string to a page of heap.
  237. Declaration     PutHeap ( Hpage : HeapBuf; HV : Char;
  238.                           S : String; X,Y : Integer;
  239.                           Att : Byte );
  240. Remarks         Copies S to Hpage with video attribute Att,
  241.                 beginning at (x,y).  HV controls output
  242.                 direction:
  243.                      'V' or 'v' - Vertically (Top to Bottom)
  244.                      any other  - Horizontally (Left to Right)
  245.                 PutHeap is the 'heap' counterpart of PutStr.
  246. Example         Center a string at the top of heap page 1.
  247.                    PutHeap ( Page[1],h,
  248.                              Center('MASTER MENU FUNCTIONS',
  249.                                      80,' '),
  250.                              1,1,14 );
  251.  
  252. -----------------------------------------------------------
  253. PutStr Procedure
  254. -----------------------------------------------------------
  255. Purpose         Writes a string to video memory.
  256. Declaration     PutStr ( HV : Char; S : String;
  257.                          X,Y : Integer; Att : Byte );
  258. Remarks         Copies S to video memory with video attribute 
  259.                 Att, beginning at (x,y).  HV controls output
  260.                 direction:
  261.                      'V' or 'v' - Vertically (Top to Bottom)
  262.                      any other  - Horizontally (Left to Right)
  263.                 PutStr writes S then advances the cursor by
  264.                 the length of S + 1.
  265. See also        Pdq, CtrScr
  266. Example         Center a string at the top of the screen.
  267.                    PutStr ( h,
  268.                             Center('MASTER MENU FUNCTIONS',
  269.                                     80,' '),
  270.                             1,1,14 );
  271.                           
  272. -----------------------------------------------------------
  273. RemBlk Procedure
  274. -----------------------------------------------------------
  275. Purpose         Clears an area of the screen.
  276. Declaration     RemBlk ( x1,y1,x2,y2 : Integer );
  277. Remarks         Writes blanks with a video attribute of 14
  278.                 to the block of video memory defined by
  279.                 (x1,y1), (x2,y2).
  280. See also        RemblkR
  281. Example         Clear the interior of a box.
  282.                    Box    ( 20, 5, 60, 15, 1, 14 );
  283.                    RemBlk ( 21, 6, 59, 14 );
  284.  
  285. -----------------------------------------------------------
  286. RemBlkR Procedure
  287. -----------------------------------------------------------
  288. Purpose         Clears an area of the screen with a specified
  289.                 attribute.
  290. Declaration     RemBlkR ( x1,y1,x2,y2 : Integer; Att : Byte );
  291. Remarks         Writes blanks with video attribute Att
  292.                 to the block of video memory defined by
  293.                 (x1,y1), (x2,y2).
  294. See also        Remblk
  295. Example         Clear the interior of a box.
  296.                    Box     ( 20, 5, 60, 15, 1, 30 );
  297.                    RemBlkR ( 21, 6, 59, 14, 30 );
  298.  
  299. -----------------------------------------------------------
  300. RestoreScreen Procedure
  301. -----------------------------------------------------------
  302. Purpose         Copies a page of heap to the screen.
  303. Declaration     RestoreScreen ( Hpage : HeapBuf );
  304. Remarks         Copies the contents of Hpage to video
  305.                 memory.
  306. See also        Heap2Scr, SaveScreen, Scr2Heap
  307. Example         Restore a menu screen previously saved to
  308.                 page 3 of the heap.
  309.                    RestoreScreen ( Page[3] );
  310.  
  311. -----------------------------------------------------------
  312. Right Function
  313. -----------------------------------------------------------
  314. Purpose         Right-justifies a string.
  315. Declaration     Right ( S : String; Width : integer; 
  316.                         Pad : Char ) : String;
  317. Result Type     String
  318. Remarks         Returns S right-justified in a field of
  319.                 size Width.  If Width is greater than the
  320.                 length of S, Pad characters are added to
  321.                 the left of S to fill out the result.
  322. See also        Left, Center
  323. Example         Display a padded dollar figure.
  324.                    S := '$149.99';
  325.                    Width := 10;
  326.                    PutStr ( h, Right(S,Width,'*'),
  327.                             1, 1, 14 );
  328.                    {---  Displays '***$149.99' ---}
  329.  
  330. -----------------------------------------------------------
  331. Rword Function
  332. -----------------------------------------------------------
  333. Purpose         Replaces a word with a string.
  334. Declaration     Rword ( Original : String; N : Integer;
  335.                         ReplaceWith : String ) : String;
  336. Result Type     String
  337. Remarks         Returns a string with ReplaceWith replacing 
  338.                 word N of Original.  If Original is null or
  339.                 N is less than 1, Rword returns a null string.
  340.                 If N is greater than the number of words in
  341.                 Original, then Rword returns Original.
  342. See also        Space, SubWord, WordN, Words, WordPos, WordInd
  343. Example         Modify a string.
  344.                    Phrase := 'This was the result:';
  345.                    Phrase := Rword(Phrase,2,'should have been');
  346.                    {--- Phrase is now 
  347.                         'This should have been the result:'
  348.                    ---}
  349.  
  350. -----------------------------------------------------------
  351. SaveScreen Procedure
  352. -----------------------------------------------------------
  353. Purpose         Copies the screen to a page of heap.
  354. Declaration     SaveScreen ( Hpage : HeapBuf );
  355. Remarks         Copies the contents of video memory to Hpage.
  356. See also        Scr2Heap, Heap2Scr, RestoreScreen
  357. Example         Save the current screen to page 3 of the heap.
  358.                    SaveScreen ( Page[3] );
  359.  
  360. -----------------------------------------------------------
  361. Scr2Disk Procedure
  362. -----------------------------------------------------------
  363. Purpose         Copies the screen to disk file.
  364. Declaration     Scr2Disk ( FileDesc  : String;
  365.                            ScreenNum : Integer; 
  366.                            var Ecode : Integer );
  367. Remarks         Copies the contents of video memory to the
  368.                 disk file defined by FileDesc, as screen 
  369.                 number ScreenNum.  Ecode indicates the 
  370.                 success of the operation:
  371.                    0 - successful
  372.                    3 - path not found
  373.                    4 - no handle available
  374.                    5 - access denied
  375.                    6 - disk full
  376.                 Scr2Disk attempts to open, write to, and
  377.                 close FileDesc.
  378. See also        Disk2Mem, Fil2Heap
  379. Example         Copy the screen to Help.Txt as screen number 2.
  380.                    Scr2Disk ( 'C:\Help.Txt',2,Ecode );
  381.                    if Ecode = 0 then 
  382.                       ClrScr
  383.                    else
  384.                       SaveProblem;
  385.  
  386. -----------------------------------------------------------
  387. Scr2Heap Procedure
  388. -----------------------------------------------------------
  389. Purpose         Copies an area of the screen to the heap.
  390. Declaration     Scr2Heap ( Hpage : HeapBuf; 
  391.                            x1,y1,x2,y2,x3,y3 : Integer );
  392. Remarks         Copies the block of video memory given by
  393.                 (x1,y1), (x2,y2) to Hpage beginning at
  394.                 (x3,y3).  
  395. See also        SaveScreen, Heap2Scr, RestoreScreen
  396. Example         Copy an information box to Page 1.
  397.                    Scr2Heap ( Page[1], 20, 2, 60, 12, 1, 1 );
  398.  
  399. -----------------------------------------------------------
  400. SetAtt Procedure
  401. -----------------------------------------------------------
  402. Purpose         Sets the video attributes of a portion of
  403.                 the screen.
  404. Declaration     SetAtt ( x1,y1,x2,y2 : Integer;
  405.                          Att : Byte );
  406. Remarks         Sets the attributes of the area given by 
  407.                 (x1,y1), (x2,y2) to Att.
  408. See also        ChgAtt, HeapAtt
  409. Example         Paint the screen blue.
  410.                    SetAtt ( 1,1,80,25,30 );
  411.  
  412. -----------------------------------------------------------
  413. SetCursor Procedure
  414. -----------------------------------------------------------
  415. Purpose         Sets the size of the cursor.
  416. Declaration     SetCursor ( StartLine, StopLine : Byte );
  417. Remarks         Sets the number of scan lines that are
  418.                 displayed as the blinking cursor.
  419.                   Monitor       Scan lines
  420.                    CGA             8 (0 - 7)
  421.                    Mono           14 (0 - 13)
  422.                    EGA            14 (0 - 13)
  423.                 Scan lines are numbered from the top,
  424.                 beginning at 0.
  425.                 (from Programmer's Guide to the IBM PC
  426.                 by Peter Norton, pg 174)
  427. See also        CursorOn, CursorOff
  428. Example         Create a block-sized cursor on a CGA.
  429.                    SetCursor ( 0, 7 );
  430.  
  431. -----------------------------------------------------------
  432. ShowDate Procedure
  433. -----------------------------------------------------------
  434. Purpose         Displays the current date.
  435. Decalration     ShowDate ( Dx, Dy : Integer; Att : Byte );
  436. Remarks         Gets the date and displays it at (Dx,Dy) with
  437.                 attribute Att. 
  438. Example         Display the date.
  439.                    ShowDate ( 1, 1, 112 );
  440.                    {--- displays 
  441.                         Sat 27 Mar 88 
  442.                         at 1,1 in reverse video ---}
  443.  
  444. -----------------------------------------------------------
  445. ShowTime Procedure
  446. -----------------------------------------------------------
  447. Purpose         Displays the current time and date.
  448. Decalration     ShowTime ( Tx,Ty,Dx,Dy : Integer; Att : Byte );
  449. Remarks         Gets the time and displays it at (Tx,Ty) with
  450.                 attribute Att. Displays the date at (Dx,Dy) 
  451.                 and refreshes it every midnight.
  452. See also        TimeXY, Stime
  453. Example         Keep a clock running until a keypress.
  454.                    Repeat
  455.                       ShowTime ( 64,1,1,1,112 );
  456.                    Until Keypressed;
  457.  
  458. -----------------------------------------------------------
  459. Space Function
  460. -----------------------------------------------------------
  461. Purpose         Controls padding between words of a string.
  462. Declaration     Space ( S : String; N : Integer;
  463.                         Pad : Char ) : String;
  464. Result Type     String
  465. Remarks         Returns a string with S modified as follows:
  466.                    - leading and trailing blanks removed
  467.                    - N copies of Pad inserted between each
  468.                      word of S
  469.                 If N = 1 and Pad is a blank, then Space
  470.                 returns a normalized string.  If N = 0,
  471.                 then Space concatenates the words of S.
  472.                 If S is null or a string of blanks, then
  473.                 Space returns a null string.
  474. See also        Rword, Subword, WordN, Words, WordPos, WordInd
  475. Example         Normalize a string.
  476.                     S := 'Lilburn,   Georgia   30247';
  477.                     S := Space(S,1,' ');
  478.                     {--- assigns 
  479.                          'Lilburn, Georgia 30247' 
  480.                          to S ---}
  481.  
  482. -----------------------------------------------------------
  483. SplitCloseH Procedure
  484. -----------------------------------------------------------
  485. Purpose         Displays a screen by sliding it from the
  486.                 sides to the center in a horizontal direction.
  487. Declaration     SplitCloseH ( FrontPage : HeapBuf;
  488.                               Brake     : Integer );
  489. Remarks         FrontPage is displayed as if it were two 
  490.                 sliding doors closing from the sides and
  491.                 meeting at the middle.  Brake controls the
  492.                 speed of the closing.
  493. See also        SplitCloseV, SplitOpenH, SplitOpenV, Tile,
  494.                 Hwipe, Vwipe
  495. Example         Restore a screen.
  496.                    
  497.                    {--- Save the current screen ---}
  498.                    SaveScreen ( Page[1] );
  499.  
  500.                    {--- Slide in a new screen ---}
  501.                    SplitCloseH ( Page[2], 5 );
  502.                    
  503.                    {--- Restore the original screen ---}
  504.                    SplitOpenH ( Page[1], Page[2], 5 );
  505.  
  506. -----------------------------------------------------------
  507. SplitCloseV Procedure
  508. -----------------------------------------------------------
  509. Purpose         Displays a screen by sliding it from the
  510.                 top and bottom to meet at the center.
  511. Declaration     SplitCloseV ( FrontPage : HeapBuf;
  512.                               Brake     : Integer );
  513. Remarks         FrontPage is displayed as if it were two 
  514.                 sliding doors closing from the top and
  515.                 bottom to meet at the middle.  Brake controls
  516.                 the speed of the closing.
  517. See also        SplitCloseH, SplitOpenH, SplitOpenV, Tile,
  518.                 Hwipe, Vwipe
  519. Example         Restore a screen.
  520.                    
  521.                    {--- Save the current screen ---}
  522.                    SaveScreen ( Page[1] );
  523.  
  524.                    {--- Slide in a new screen ---}
  525.                    SplitCloseV ( Page[2], 5 );
  526.                    
  527.                    {--- Restore the original screen ---}
  528.                    SplitOpenV ( Page[1], Page[2], 5 );
  529.  
  530. -----------------------------------------------------------
  531. SplitOpenH Procedure
  532. -----------------------------------------------------------
  533. Purpose         Displays a screen by sliding back the current
  534.                 screen from the center to the sides.
  535. Declaration     SplitOpenH ( BackPage, FrontPage : HeapBuf;
  536.                              Brake     : Integer );
  537. Remarks         BackPage is displayed by sliding FrontPage
  538.                 from the center to the sides, as if two doors
  539.                 were sliding open.  Brake controls the speed
  540.                 of the opening.
  541. See also        SplitCloseH, SplitCloseV, SplitOpenV, Tile,
  542.                 Hwipe, Vwipe
  543. Example         Restore a screen.
  544.                    
  545.                    {--- Save the current screen ---}
  546.                    SaveScreen ( Page[1] );
  547.  
  548.                    {--- Slide in a new screen ---}
  549.                    SplitCloseH ( Page[2], 5 );
  550.                    
  551.                    {--- Restore the original screen ---}
  552.                    SplitOpenH ( Page[1], Page[2], 5 );
  553.  
  554. -----------------------------------------------------------
  555. SplitOpenV Procedure
  556. -----------------------------------------------------------
  557. Purpose         Displays a screen by sliding back the current
  558.                 screen from the center to the top and bottom.
  559. Declaration     SplitOpenV ( BackPage, FrontPage : HeapBuf;
  560.                              Brake     : Integer );
  561. Remarks         BackPage is displayed by sliding FrontPage
  562.                 from the center to the top and bottom, as if 
  563.                 two doors were sliding open.  Brake controls 
  564.                 the speed of the opening.
  565. See also        SplitCloseH, SplitCloseV, SplitOpenH, Tile,
  566.                 Hwipe, Vwipe
  567. Example         Restore a screen.
  568.                    
  569.                    {--- Save the current screen ---}
  570.                    SaveScreen ( Page[1] );
  571.  
  572.                    {--- Slide in a new screen ---}
  573.                    SplitCloseV ( Page[2], 5 );
  574.                     
  575.                    {--- Restore the original screen ---}
  576.                    SplitOpenV ( Page[1], Page[2], 5 );
  577.  
  578.  
  579. -----------------------------------------------------------
  580. Stime Procedure
  581. -----------------------------------------------------------
  582. Purpose         Initializes the system time.
  583. Declaration     Stime ( HH, MM, SS : Integer );
  584. Remarks         Sets the clock to the hour (hh), minute (mm),
  585.                 and seconds (ss) specified.  Military time
  586.                 format assumed.  If the time is not valid, it
  587.                 is not set.
  588. See also        TimeXY, ShowTime, SetTime (in DOS unit)
  589. Example         Set the system clock to 3:05:00 p.m.
  590.                    Stime ( 15, 5, 0 );
  591.                 
  592. -----------------------------------------------------------
  593. Strip Function
  594. -----------------------------------------------------------
  595. Purpose         Removes leading and trailing characters from
  596.                 a string.
  597. Declaration     Strip ( S : String; Pad : Char ) : String;
  598. Result Type     String
  599. Remarks         Returns S with leading and trailing Pad
  600.                 characters removed.
  601. See also        StripR
  602. Example         Remove underscores from an input field.
  603.                     Field := 'Miami____';
  604.                     Field := Strip(Field,'_');
  605.                     {--- Field is now 'Miami' ---}
  606.  
  607. -----------------------------------------------------------
  608. StripR Function
  609. -----------------------------------------------------------
  610. Purpose         Removes leading, trailing or both leading 
  611.                 and trailing characters from a string.
  612. Declaration     Strip ( S : String; Option, Pad : Char ) 
  613.                       : String;
  614. Result Type     String
  615. Remarks         Returns S with leading or trailing Pad 
  616.                 characters removed according to the 
  617.                 value of Option:
  618.                    'L' - leading only
  619.                    'T' - trailing only
  620.                    'B' - both leading and trailing
  621.                 Option is not case-sensitive; i.e., lower-
  622.                 case characters may used as well.
  623. See also        Strip
  624. Example         Remove trailing characters from a string.
  625.                     Field := '$5,200,188.00';
  626.                     Field := StripR(StripR(Field,'T','0'),'T','.');
  627.                     {--- Field is now 
  628.                          '$5,200,188' ---}
  629.  
  630. -----------------------------------------------------------
  631. SubWord Function
  632. -----------------------------------------------------------
  633. Purpose         Returns a substring of S.
  634. Declaration     SubWord ( S : String; N, NumWords : Integer )
  635.                         : String;
  636. Result Type     String
  637. Remarks         Returns NumWords words of S, beginning with
  638.                 word N.  Returns a null string if S is null,
  639.                 or all blanks, or if N is greater than the
  640.                 number of words in S.
  641. See also        Rword, Space, WordInd, WordPos, WordN, Words
  642. Example         Extract a substring from a string.
  643.                    S := 'This is the right stuff.';
  644.                    S := SubWord(S,3,3);
  645.                    {---  S is now 'the right stuff.'  ---}
  646.  
  647. -----------------------------------------------------------
  648. Tile Procedure
  649. -----------------------------------------------------------
  650. Purpose         Copies a block from the heap to the screen
  651.                 in a tiling pattern.
  652. Declaration     Tile ( Hpage : HeapBuf; 
  653.                        X1,Y1,X2,Y2,X3,Y3,Delay : Integer );
  654. Remarks         A special-effects routine that transfers
  655.                 the block defined by (x1,y1), (x2,y2) on 
  656.                 Hpage to the screen beginning at (x3,y3).
  657.                 Delay is a value used in an empty for-loop.
  658. See also        Hwipe, Vwipe, SplitCloseH, SplitOpenH,
  659.                 SplitCloseV, SplitOpenV
  660. Example         Tile a block from page 1 of the heap.
  661.                    Tile ( Page[1], 
  662.                           20, 5, 50, 10, 1, 1, 150 );
  663.                    {--- The block at (20,5), (50,10) on
  664.                         Page[1] is tiled to the area
  665.                         beginning at (1,1) on the screen.
  666.                         Uses a 150 delay ---}
  667.  
  668. -----------------------------------------------------------
  669. Timer Function
  670. -----------------------------------------------------------
  671. Purpose         Sets an elapsed time clock.
  672. Declaration     Timer ( Limit : Integer ) : Boolean;
  673. Result Type     Boolean
  674. Remarks         Returns TRUE if the number of seconds elapsed
  675.                 since Time's invocation equals or exceeds
  676.                 Limit.  Otherwise, Timer returns FALSE.
  677.                 Calls to Timer should not be nested.
  678.  
  679.                 In contrast to Turbo Pascal's Delay procedure,
  680.                 Timer does not suspend program execution.  It
  681.                 simply keeps track of the time elapsed since
  682.                 it was first called.
  683. See also        Wait
  684. Example         Contrast Timer and Delay.
  685.                    {--- Loop for 3 seconds.  This will
  686.                         write 'Boosters' to the screen
  687.                         over and over until 3 seconds
  688.                         have elapsed ---}
  689.                    Repeat
  690.                       Writeln('Boosters');
  691.                    Until Timer(3);
  692.  
  693.                    {--- Delay for 3 seconds.  This will
  694.                         write 'Boosters' once, wait 3
  695.                         seconds, then exit the Repeat ---}
  696.                    Repeat
  697.                       WriteLn('Bosters');
  698.                       Delay(3000);
  699.                    Until 'a' = 'a';
  700.  
  701. -----------------------------------------------------------
  702. TimeXY Procedure
  703. -----------------------------------------------------------
  704. Purpose         Displays the system time at (x,y).
  705. Declaration     TimeXY ( X,Y : Integer; Att : Byte );
  706. Remarks         Gets the system time and displays it at
  707.                 (x,y) with attribute Att.  The cursor is
  708.                 not affected.
  709. See also        ShowTime
  710. Example         Display the system time in reverse video.
  711.                    TimeXY ( 66, 1, 112 );
  712.  
  713. -----------------------------------------------------------
  714. Translate Function
  715. -----------------------------------------------------------
  716. Purpose         Convert characters in a string by means of
  717.                 a translate table.
  718. Declaration     Translate ( S, InTable, OutTable : String;
  719.                             Pad : Char ) : String;
  720. Result Type     String
  721. Remarks         Characters of S are compared against the 
  722.                 contents of InTable.  If a match occurs, the 
  723.                 element at the same position in OutTable is 
  724.                 copied to the return string.  If a character 
  725.                 of S is not found in InTable, it is copied 
  726.                 to the return string unchanged.  
  727.  
  728.                 When an element of S is found in InTable and 
  729.                 its position in InTable exceeds the length 
  730.                 of OutTable, Pad character is copied to the 
  731.                 return string.  
  732.  
  733.                 If OutTable is null, every character in S 
  734.                 found in InTable is deleted from the return 
  735.                 string.  
  736. Examples        Translate some strings.
  737.                   s := 'include-file';
  738.                   s := translate ( s, '-',' ',' ');
  739.                   {--- S is now 'include file' ---}
  740.  
  741.                   S := translate ( 'aei', 'eia', '12', '$');
  742.                   {--- S is set to $12 ---}
  743.  
  744.                   Null := '';
  745.                   S := translate ( 'xlate','x',Null,' ');
  746.                   {--- S is set to 'late' ---}
  747.  
  748. -----------------------------------------------------------
  749. Upper Function
  750. -----------------------------------------------------------
  751. Purpose         Converts alphabetics to uppercase.
  752. Declaration     Upper ( S : String ) : String;
  753. Result Type     String
  754. Remarks         Returns a string with the lowercase letters
  755.                 of S converted to uppercase.  
  756. See also        Lower
  757. Example         Convert a string to uppercase.
  758.                    S := 'Location';
  759.                    S := Upper(S);
  760.                    {--- S is now 'LOCATION' ---}
  761.  
  762. -----------------------------------------------------------
  763. Verify Function
  764. -----------------------------------------------------------
  765. Purpose         Verifies that a string is composed only of
  766.                 certain characters.
  767. Declaration     Verify ( S, Reference : String; 
  768.                          Start : Integer ) : Integer;
  769. Result Type     Integer
  770. Remarks         Verifies that S is composed only of 
  771.                 characters from Reference.   If all 
  772.                 characters in S are members of Reference, 
  773.                 Verify returns a zero.  Otherwise, Verify 
  774.                 returns the position of the first character 
  775.                 in S not found in Reference.  The 
  776.                 verification begins at S[Start].  
  777. Example         Verify a string.
  778.                    s := Verify('01-01-80','0123456789/',1);
  779.  
  780.                    {---  Assigns 3 to s, since the '-' is
  781.                          not a member of the reference set 
  782.                     ---}
  783.  
  784. -----------------------------------------------------------
  785. Vwipe Procedure
  786. -----------------------------------------------------------
  787. Purpose         Copies a block to the screen using a 
  788.                 vertical wipe technique.
  789. Declaration     Vwipe ( Hpage : HeapBuf; 
  790.                         X1,Y1,X2,Y2,X3,Y3,Delay : Integer );
  791. Remarks         Writes a block from the heap to the screen
  792.                 one row at a time, top-to-bottom, creating
  793.                 a vertical wipe effect.  Delay is the
  794.                 terminating value of an empty for-loop
  795.                 which is performed between row writes.
  796.  
  797.                 The block on the heap is defined by (x1,y1),
  798.                 (x2,y2), while the screen destination is
  799.                 given by (x3,y3).
  800. See also        Hwipe, Tile, SplitCloseH, SplitCloseV,
  801.                 SplitOpenH, SplitOpenV
  802. Example         Wipe a block from the heap to the screen.
  803.                    Vwipe ( Page[1],20,10,60,20,20,10,200 );
  804.  
  805. -----------------------------------------------------------
  806. Wait Procedure
  807. -----------------------------------------------------------
  808. Purpose         Delays execution for a specified time or
  809.                 a specified keypress.
  810. Declaration     Wait ( NumberOfSeconds : integer;
  811.                        Var C : Char );
  812. Remarks         Wait for NumberOfSeconds seconds to elapse
  813.                 or a keypress, the value of which is 
  814.                 returned in C.
  815. See also        Timer
  816. Example         Control the displaying of screens.
  817.                    Repeat
  818.                       C := Escape;
  819.                       Wait ( 5, C );
  820.                       if C = #0 then C := readkey;
  821.                       case C of
  822.                         Home : RestoreScreen ( Page[1] );
  823.                         End  : RestoreScreen ( Page[2] );
  824.                       end;
  825.                   Until C = Escape;
  826.  
  827. -----------------------------------------------------------
  828. WordInd Function
  829. -----------------------------------------------------------
  830. Purpose         Returns the starting position of a word in
  831.                 a string.
  832. Declaration     WordInd ( S : String; N : Integer ) : Integer;
  833. Result Type     Integer
  834. Remarks         Searches for the string position of word N
  835.                 in S.  Returns 0 if S is null or all blanks,
  836.                 or if N is less than 1 or greater than the 
  837.                 number of words in S.  
  838. See also        WordPos
  839. Example         Find the starting position of 'fox' below.
  840.                    S := 'The quick brown fox';
  841.                    start := WordInd ( S, 4);
  842.                    {--- Since 'fox' is word 4, start is 17, 
  843.                         corresponding to the 'f' in fox ---}
  844.  
  845. -----------------------------------------------------------
  846. WordN Function
  847. -----------------------------------------------------------
  848. Purpose         Returns word N of S.
  849. Declaration     WordN ( S : String; N : Integer ) : String;
  850. Result Type     String
  851. Remarks         Returns a null string if S is null or all
  852.                 blanks, or if N is less than 1 or greater
  853.                 than the number of words in S.
  854. See also        SubWord
  855. Example         Extract the last word of any string.
  856.                    S := WordN ( S, Words(S) );
  857.  
  858. -----------------------------------------------------------
  859. WordPos Function
  860. -----------------------------------------------------------
  861. Purpose         Returns the starting word position of 
  862.                 Needle in HayStack.
  863. Declaration     WordPos ( Needle, HayStack : String;
  864.                           Start, IgnoreSpaces : Integer )
  865.                           : Integer;
  866. Result Type     Integer;
  867.                 Returns the starting word position of 
  868.                 Needle in HayStack.  Start is the word 
  869.                 position within HayStack at which to 
  870.                 begin the search.  
  871.  
  872.                 When IgnoreSpaces = 0, then extra spaces 
  873.                 between words are significant; when 
  874.                 IgnoreSpaces = 1, then extra spaces are 
  875.                 ignored.  
  876. See also        Posr, LastPos, or Turbo Pascal's Pos
  877. Example         Find a starting word position of a string.
  878.                    S := 'A b c';
  879.                    P := WordPos ( Upper(S), 'A   A   B   C', 
  880.                                    1, 1);
  881.                    {---
  882.                        Above, WordPos will assign 2 to P 
  883.                        because needle begins at word 2 of 
  884.                        haystack.  Note that differences in
  885.                        spacing are ignored, as are 
  886.                        differencs in case by virtue of 
  887.                        Upper(S).
  888.                    ---}
  889.  
  890. -----------------------------------------------------------
  891. Words Function
  892. -----------------------------------------------------------
  893. Purpose         Returns the number of words in a string.
  894. Declaration     Words ( S : String; ) : Integer;
  895. Result Type     Integer
  896. Remarks         Returns a count of blank-delimiited words
  897.                 in S.  
  898. Example         List each word of a string in one column.
  899.                    for i := 1 to words(S) do
  900.                       WriteLn( WordN(S,i) );
  901.  
  902.